
//
//  NewerCollectionViewCell.m
//  ZYZB
//
//  Created by ENERGY on 2018/6/29.
//  Copyright © 2018年 ENERGY. All rights reserved.
//

#import "ClassifyCollectionViewCell.h"
@interface ClassifyCollectionViewCell()
@end

@implementation ClassifyCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        __weak typeof (self)weakSelf = self;
        self.contentView.backgroundColor = [UIColor whiteColor];
        [self.contentView addSubview:self.contentLab];
        [self.contentLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.right.top.bottom.equalTo(weakSelf.contentView);
        }];
    }return self;
}

- (UILabel *)contentLab{
    if (!_contentLab) {
        _contentLab = [[UILabel alloc] init];
        _contentLab.font = DEF_FontSize_10;
        _contentLab.textColor = getColor(@"a0a0a0");
        _contentLab.textAlignment = NSTextAlignmentCenter;
        _contentLab.text = @"供应链系列";
        _contentLab.layer.borderColor = getColor(@"737373").CGColor;
        _contentLab.layer.cornerRadius = 6;
        _contentLab.layer.masksToBounds = YES;
        _contentLab.layer.borderWidth = 1;
    }return _contentLab;
}

- (void)setSelected:(BOOL)selected{
    [super setSelected:selected];
    if (selected) {
        self.contentLab.layer.borderColor = [UIColor orangeColor].CGColor;
        self.contentLab.textColor = [UIColor orangeColor];
//        [[NSNotificationCenter defaultCenter]postNotificationName:@"buttonTextChange" object:nil userInfo:@{@"buttonText":self.contentLab.text}];
    }else{
        self.contentLab.layer.borderColor = getColor(@"737373").CGColor;
        self.contentLab.textColor = getColor(@"a0a0a0");
    }
}

- (void)setModel:(NSDictionary *)model{
    _model = model;
    self.contentLab.text = model[@"twolab"];
    self.contentID = model[@"tid"];
}
@end
